package file;

import java.io.File;
import java.io.FileFilter;

public class ListFilesDemo {
    public static void main(String[] args) {
        File file = new File(".");
        /*if (file.isDirectory()){
            File[] subs = file.listFiles();
            for (File sub : subs){
                System.out.println(sub.getName());
            }
        }else {
            System.out.println("不是目录");
        }
         */

        File[] subs = file.listFiles(f-> f.getName().startsWith("."));
        for (File sub : subs){
            System.out.println(sub.getName());
        }



    }
}
